package com.gykfbxxh.imovie.base.bean;

import java.util.List;

/**
 * 泛型网络解析类
 * @author xuxinghai
 */

public class DataBean<T> {

	private int allcount;//数量
	private String code ;// 错误标识   OperateOk 正确
	private String errorMsg;//提示信息

	private List<T> result;

	public int getAllcount() {
		return allcount;
	}

	public void setAllcount(int allcount) {
		this.allcount = allcount;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public List<T> getResult() {
		return result;
	}

	public void setResult(List<T> result) {
		this.result = result;
	}

	public boolean noError(){
		if("OperateOk".equals(code)) {
			return true;
		}
		return false;
	}
	/**
	 * 返回默认的错误json字符串
	 * @return
	 */
	public static String getDefaultJson(){
		String json = "{'allcount':'1','errorMsg':'数据返回空'}";
		return json;
	}
}
